package cn.lhl01.config;

import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

///@Configuration
public class WebConfig implements WebMvcConfigurer {

	/**
	 * 跨域
	 */
	@Override
	public void addCorsMappings(CorsRegistry registry) {
		registry.addMapping("/**")
				.allowCredentials(true)
				.allowedMethods("*")
				//.allowedOrigins("*")
				.allowedOriginPatterns("*")
				.allowedHeaders("*")
				.maxAge(3600L);
	}


}
